#include "IAPInfo.h"
#include "cocos2d.h"
#include "../Data/GameData.h"
#include "../Support/GameSupport.h"
#define kPlayerIAPMode "_mode_fullversion_"
USING_NS_CC;

IAPInfo::IAPInfo()
{

}

void IAPInfo::reset()
{
	setModeFullVersion(EGameMode::kMode_Easy, false);
	setModeFullVersion(EGameMode::kMode_Normal, false);
	setModeFullVersion(EGameMode::kMode_Hard, false);
}

void IAPInfo::setModeFullVersion(EGameMode mode, bool enable)
{
	UserDefault::getInstance()->setBoolForKey(String::createWithFormat("%s%s", GameSupport::getTextMode(mode),
		kPlayerIAPMode)->getCString(), enable);
}

bool IAPInfo::getModeFullVersion(EGameMode mode)
{
	return UserDefault::getInstance()->getBoolForKey(String::createWithFormat("%s%s", GameSupport::getTextMode(mode),
		kPlayerIAPMode)->getCString());
}